/**
 * 
 */
package com.mes.check.domain;

import com.mes.common.domain.BasicModel;
import com.mes.task.domain.OperationTask;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.context.annotation.Lazy;

import com.mes.basicdata.domain.Dept;
import com.mes.basicdata.domain.Employee;

/**
 * <p>
 * 不合格品审理单明细
 * </p>
 */
@Entity()
@Table(name = "M_DEFECTJUDGEDETAIL")
@BatchSize(size = 20)
@Lazy(value = true)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class DefectJudgeDetail extends BasicModel implements java.io.Serializable {

	@Id
	@GenericGenerator(name = "uniqueId", strategy = "assigned")
	@Column(name = "UNIQUEID")
	protected String uniqueId;
	
	// 序列号
	@Column(name = "SEQ", length = 50)
	protected Integer seq;

	// 缺陷审表编号
	@Column(name = "DEFECTJUDGEUID", length = 50)
	protected String defectJudgeUid;
	// 缺陷审理表表头
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DEFECTJUDGEUID", insertable = false, updatable = false)
	protected DefectJudge defectJudge;

	// 缺陷零件数量
	@Column(name = "DEFECTQTY", length = 50)
	protected Float defectQty;

	// 审理原因
	@Column(name = "JUDGERESULT", length = 50)
	protected String judgeResult;

	// 缺陷率
	@Column(name = "DEFECTLEVEL", length = 50)
	protected Integer defectLevel;

	// 缺陷描述
	@Column(name = "DEFECTDESC", length = 50)
	protected String defectDesc;

	// 物料序列号
	@Column(name = "MATERIALSNS", length = 50)
	protected String materialSns;

	@Column(name = "MATERIALUSN", length = 50)
	protected String materialUid;

	// 关系表标号
	@Column(name = "RELATIONBILLUID", length = 50)
	protected String relationBillUid;

	@Column(name = "RELATIONBILLID", length = 50)
	protected String relationBillId;

	@Column(name = "DEFECTREASON", length = 50)
	protected String defectReason;

	// 值班任务编号
	@Column(name = "DUTYTASKUID", length = 50)
	protected String dutyTaskUid;
	// 值班任务
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DUTYTASKUID", insertable = false, updatable = false)
	protected OperationTask dutyTask;

	// 值班员编号
	@Column(name = "DUTIER", length = 50)
	protected String dutierUid;
	// 值班员
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DUTIER", insertable = false, updatable = false)
	protected Employee dutier;

	@Column(name = "DUTYDEPTDELEGATE", length = 50)
	protected String dutyDeptDelegateUid;
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DUTYDEPTDELEGATE", insertable = false, updatable = false)
	protected Employee dutyDeptDelegate;

	@Column(name = "DUTYDEPTID", length = 50)
	protected String dutyDeptUid;
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DUTYDEPTID", insertable = false, updatable = false)
	protected Dept dutyDept;

	// 是否成批性报废
	@Column(name = "ISALLBATCH")
	protected Boolean isBulkReject;

	// 系数 ？？？什么的系数
	@Column(name = "RATIO")
	protected Float ratio;
		
	// Constructors

	public DefectJudgeDetail() {
	}


	public String getUuid() {
		return uniqueId;
	}

	public void setUuid(String uuid) {
		this.uniqueId = uuid;
	}
	
	public String getUniqueId() {
		return uniqueId;
	}

	public void setUniqueId(String uniqueId) {
		this.uniqueId = uniqueId;
	}
	
	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public String getDefectJudgeUid() {
		return defectJudgeUid;
	}

	public void setDefectJudgeUid(String defectJudgeUid) {
		this.defectJudgeUid = defectJudgeUid;
	}

	public DefectJudge getDefectJudge() {
		return defectJudge;
	}

	public void setDefectJudge(DefectJudge defectJudge) {
		this.defectJudge = defectJudge;
	}

	public Float getDefectQty() {
		return defectQty;
	}

	public void setDefectQty(Float defectQty) {
		this.defectQty = defectQty;
	}

	public String getJudgeResult() {
		return judgeResult;
	}

	public void setJudgeResult(String judgeResult) {
		this.judgeResult = judgeResult;
	}

	public Integer getDefectLevel() {
		return defectLevel;
	}

	public void setDefectLevel(Integer defectLevel) {
		this.defectLevel = defectLevel;
	}

	public String getDefectDesc() {
		return defectDesc;
	}

	public void setDefectDesc(String defectDesc) {
		this.defectDesc = defectDesc;
	}

	public String getMaterialSns() {
		return materialSns;
	}

	public void setMaterialSns(String materialSns) {
		this.materialSns = materialSns;
	}

	public String getRelationBillUid() {
		return relationBillUid;
	}

	public void setRelationBillUid(String relationBillUid) {
		this.relationBillUid = relationBillUid;
	}

	public String getDutyTaskUid() {
		return dutyTaskUid;
	}

	public void setDutyTaskUid(String dutyTaskUid) {
		this.dutyTaskUid = dutyTaskUid;
	}

	public OperationTask getDutyTask() {
		return dutyTask;
	}

	public void setDutyTask(OperationTask dutyTask) {
		this.dutyTask = dutyTask;
	}

	public Employee getCreator() {
		return creator;
	}

	public void setCreator(Employee creator) {
		this.creator = creator;
	}

	public String getDutierUid() {
		return dutierUid;
	}

	public void setDutierUid(String dutierUid) {
		this.dutierUid = dutierUid;
	}

	public Employee getDutier() {
		return dutier;
	}

	public void setDutier(Employee dutier) {
		this.dutier = dutier;
	}

	public String getDutyDeptDelegateUid() {
		return dutyDeptDelegateUid;
	}

	public void setDutyDeptDelegateUid(String dutyDeptDelegateUid) {
		this.dutyDeptDelegateUid = dutyDeptDelegateUid;
	}

	public Employee getDutyDeptDelegate() {
		return dutyDeptDelegate;
	}

	public void setDutyDeptDelegate(Employee dutyDeptDelegate) {
		this.dutyDeptDelegate = dutyDeptDelegate;
	}

	public String getDutyDeptUid() {
		return dutyDeptUid;
	}

	public void setDutyDeptUid(String dutyDeptUid) {
		this.dutyDeptUid = dutyDeptUid;
	}

	public Dept getDutyDept() {
		return dutyDept;
	}

	public void setDutyDept(Dept dutyDept) {
		this.dutyDept = dutyDept;
	}

	public String getDefectReason() {
		return defectReason;
	}

	public void setDefectReason(String defectReason) {
		this.defectReason = defectReason;
	}

	public String getRelationBillId() {
		return relationBillId;
	}

	public void setRelationBillId(String relationBillId) {
		this.relationBillId = relationBillId;
	}

	public Boolean getIsBulkReject() {
		return isBulkReject;
	}

	public void setIsBulkReject(Boolean isBulkReject) {
		this.isBulkReject = isBulkReject;
	}

	public Float getRatio() {
		return ratio;
	}

	public void setRatio(Float ratio) {
		this.ratio = ratio;
	}

	public void setMaterialUid(String materialUid) {
		this.materialUid = materialUid;
	}


	public String getMaterialUid() {
		return materialUid;
	}

}
